package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.SpecialOffer;
import com.weipai.springboot.module.dao.SpecialOfferDao;
import com.weipai.springboot.module.mapper.SpecialOfferMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;

/**
 * @author songmengqiang
 * @create 2018-08-28 18:21
 **/
@Repository
public class SpecialOfferDaoImpl implements SpecialOfferDao {

    @Autowired
    private SpecialOfferMapper specialOfferMapper;

    @Override
    public int insert(SpecialOffer specialOffer) {
        return specialOfferMapper.insert(specialOffer);
    }

    @Override
    public List<SpecialOffer> selectAllByDel(int del) {
        return specialOfferMapper.selectAllByDel(del);
    }

    @Override
    public int updateByPrimaryKey(SpecialOffer specialOffer) {
        return specialOfferMapper.updateByPrimaryKeySelective(specialOffer);
    }

    @Override
    public SpecialOffer getSpecialOfferById(String specialOfferId) {
        return specialOfferMapper.getSpecialOfferById(specialOfferId);
    }

    @Override
    public int updateDel(String specialOfferId) {
        return specialOfferMapper.updateDel(specialOfferId);
    }

    @Override
    public int updateStatus(String specialOfferId, Integer status) {
        return specialOfferMapper.updateStatus(specialOfferId, status);
    }

    @Override
    public int batchDeleteById(String[] id) {
        return specialOfferMapper.batchDeleteById(id);
    }

    @Override
    public List<SpecialOffer> selectAllByPage(Integer start, Integer size, Integer type) {
        return specialOfferMapper.selectAllByPage(start, size, type);
    }

    @Override
    public Integer selectAllByPageAmount(Integer type) {
        return specialOfferMapper.selectAllByPageAmount(type);
    }

    @Override
    public List<SpecialOffer> getSpecialOffer() {
        return specialOfferMapper.getSpecialOffer();
    }
}
